from SCons.Script import *

from .questa_tools import vlogscan, Vlog, Vsim

##########################################
## TOOL FUNCTIONS:
##   generate() and exists() are required by Scons
##########################################

def generate(env):
    env['VLOG'] = env.WhereIs('vlog')
    env['VSIM'] = env.WhereIs('vsim')

    env.Append(SCANNERS=[vlogscan])

    env.SetDefault(
            SIM_DIR='./',
            WORK = 'work',
            VLOG_ARGS=[],
            VSIM_ARGS=[],
            TOP_MOD=''
            )
    env.AddMethod(Vlog, 'Vlog')
    env.AddMethod(Vsim, 'Vsim')

def exists(env):
    return True

